package com.zxy.util;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new OssHandler())
                // 同时匹配两种格式：带//的正确地址和带/的错误地址
                .addPathPatterns(
                        "/https://jostem.oss-cn-beijing.aliyuncs.com/**",
                        "/https:/jostem.oss-cn-beijing.aliyuncs.com/**"
                );

    }

}
